#! /bin/bash
/lhwl/app/mysql/bin/mysql  -uroot -ppassw0rd  -e "use wzk_Api_school;show tables;" >tables.txt
for table in `cat tables.txt`
do
echo "$table">>count.txt
/lhwl/app/mysql/bin/mysql  -uroot -ppassw0rd -e "use wzk_Api_school;select count(*) from $table;">>count.txt
done
sed -i  "/\*/d" count.txt
sed -i '$!N;s/\n/   /' count.txt
sort  -k 2 -nr count.txt >table_count.txt
rm -f count.txt
rm -f tables.txt
